﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DeepZoomPivotConstructor.VisualLib
{
    /// <summary>
    /// Abstract class that implements a simple single-unit image. Keeps track
    /// of x, y, scale, etc., so you can derive from it and play with other things.
    /// </summary>
    public abstract class VisualBasicSingleImage : Visual
    {
        /// <summary>
        /// Internal store for the width -- you can set it here!
        /// </summary>
        protected double _width = 0.0;

        /// <summary>
        /// The width
        /// </summary>
        public override double Width { get { return _width; } }

        /// <summary>
        /// The height internal store.
        /// </summary>
        protected double _height = 0.0;

        /// <summary>
        /// The Height of the visual
        /// </summary>
        public override double Height
        {
            get { return _height; }
        }

        /// <summary>
        /// The X position.
        /// </summary>
        public override double XPosition {get; set;}

        /// <summary>
        /// The Y Position
        /// </summary>
        public override double YPosition {get; set;}

        public override void Scale(double factor)
        {
            _width *= factor;
            _height *= factor;
        }

        /// <summary>
        /// Internal store of the z index
        /// </summary>
        protected int _zIndex = 1;

        /// <summary>
        /// Inc the Z index
        /// </summary>
        /// <param name="delta"></param>
        public override void IncZIndex(int delta)
        {
            _zIndex = _zIndex + delta;
        }

        /// <summary>
        /// The Z Index
        /// </summary>
        public override int ZIndex
        {
            get { return _zIndex; }
        }
    }
}
